#include "comm.hpp"

int  main()
{
    FifoHandler fifo(PATH, FILENAME, true);
    fifo.OpenForRead();
    char buffer[1024];
    while (true) 
    {
        ssize_t number = fifo.Read(buffer, sizeof(buffer));
        if (number < 0)
        {
             EXIT_ERR("Error reading from FIFO");
        }
        else if(number == 0)
        {
            std::cout << "FIFO closed" << std::endl;
            break;
        }
        else
        {
            std::cout << "Received: " << buffer << std::endl;
        }
       
    }

    return 0;
}
